﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Principal;
using Moq;

namespace Universum.Unit.Tests.Controllers
{
	public class with_user_logged : ControllerContext
	{

		internal IPrincipal Principal { get; set; }
		internal Mock<IPrincipal> PrincipalMock { get; set; }

		public with_user_logged()
		{

		}
		protected override void EstablishContext()
		{
			PrincipalMock = arrange_principal_to_return_owner("mihai");
			Principal = PrincipalMock.Object;
		}

		private static Mock<IPrincipal> arrange_principal_to_return_owner(string owner)
		{
			var principalMock = new Mock<IPrincipal>();
			principalMock.SetupGet(p => p.Identity.Name).Returns(owner);

			return principalMock;
		}
	}
}
